#include "pubsubserver_better.h"

using namespace yhaida;

int main(int argc, char* argv[])
{
  if (argc > 1)
  {
    uint16_t port = static_cast<uint16_t>(atoi(argv[1]));
    EventLoop loop;
    pubsub::PubSubServerBetter server(&loop, InetAddress(port));
    if (argc > 2)
    {
      server.setThreadNumber(atoi(argv[2]));
    }
    server.start();
    loop.loop();
  }
  else
  {
    printf("Usage: %s pubsub_port [inspect_port]\n", argv[0]);
  }
}